<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <style>
    
  </style>
</head>
<body>
  
</body>
<script>

  // const arr = ["hello", 4,5,6, "world"];

  // let msg = arr[0];
  // let a = arr[1];
  // let b = arr[2];

  // let [w, msg, a, b, q, s] = arr;

  // console.log(msg)
  // console.log(a)
  // console.log(b)
  // console.log(q)
  // console.log(w)
  // console.log(s)

  // =======

  // const obj = {
  //   name:"admin",
  //   age:19,
  //   sex:"男"
  // }

  // let name = obj.name;
  // let age = obj.age;
  // let sex = obj.sex;

  // let { sex, name, age, hobby } = obj;

  // console.log(name)
  // console.log(age)
  // console.log(sex)
  // console.log(hobby);

  // =========

  // let str = "hello world";

  // let [a,b,c,d,f,g,h,j] = str;

  // console.log(a)
  // console.log(b)
  // console.log(c)
  // console.log(d)
  // console.log(f)
  // console.log(g)
  
  // =========

  // 场景

  // 参数的解构
  // function fn( { left, right, index } ){}
  // fn( {left:左, right:右按钮, img:图片, index:索引, autroPlay:自动播放, delayTime:延迟时间} )

  // 返回值的解构
  // function fn(){
  //   return { year: 2023, month: 8, date:25, day:"五" }
  // }
  // const {year, month, date, day} = fn();

  // let a = "hello";
  // let b = "world";
  // 快速交换两个变量的值
  // [b, a] = [a, b];
  // console.log(a, b);
  
</script>
</html>